import request from "@/utils/request";

// 用户注册
export function registerApi(params: any) {
  return request({
    url: "/user/register",
    method: "post",
    data: params,
  });
}

// 用户登录
export function loginApi(data: any) {
  return request({
    url: "/user/login",
    method: "post",
    data,
  });
}

// 用户登出
export function logoutApi() {
  return request({
    url: "/user/logout",
    method: "post",
  });
}

// 获取用户信息(当前用户)
export function getUserInfoApi() {
  return request({
    url: "/user/get_info",
    method: "get",
  });
}

// 获取用户信息(指定用户)
export function getSpecifiedUserInfoApi(params: any) {
  return request({
    url: "/user/get_user_info",
    method: "get",
    params,
  });
}

// 更新用户信息(当前用户)
export function updateUserInfoApi(data: any) {
  return request({
    url: "/user/update_user_info",
    method: "put",
    data,
  });
}

// 获取用户列表
export function getUserListApi(params: any) {
  return request({
    url: "/user/get_user_list",
    method: "get",
    params,
  });
}

// 确认密码
export function confirmPasswordApi(data: any) {
  return request({
    url: "/user/confirm_password",
    method: "post",
    data,
  });
}
